package com.laikan.reader.database;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Transient;

@Entity
public class History {

    @Id
    private String bookId;
    private String bookName;    //书籍名称
    private String bookCover;   //书籍封面图片URL
    private String authorName;  //作者名字
    private String lastReadChapter; //最后阅读章节
    private Long lastReadTime;  //最后阅读时间
    @Transient
    private Boolean isSelected = false;

    @Generated(hash = 738764105)
    public History(String bookId, String bookName, String bookCover,
            String authorName, String lastReadChapter, Long lastReadTime) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.bookCover = bookCover;
        this.authorName = authorName;
        this.lastReadChapter = lastReadChapter;
        this.lastReadTime = lastReadTime;
    }

    @Generated(hash = 869423138)
    public History() {
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookCover() {
        return bookCover;
    }

    public void setBookCover(String bookCover) {
        this.bookCover = bookCover;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getLastReadChapter() {
        return lastReadChapter;
    }

    public void setLastReadChapter(String lastReadChapter) {
        this.lastReadChapter = lastReadChapter;
    }

    public Long getLastReadTime() {
        return lastReadTime;
    }

    public void setLastReadTime(Long lastReadTime) {
        this.lastReadTime = lastReadTime;
    }

    public Boolean getSelected() {
        return isSelected;
    }

    public void setSelected(Boolean selected) {
        isSelected = selected;
    }

    public Book convertBookBean() {
        Book book = new Book();
        book.setId(getBookId());
        book.setAuthorName(getAuthorName());
        book.setIcon(getBookCover());
        book.setName(getBookName());
        return book;
    }
}
